home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7660 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: hex to dec function?
  5. Date: 27 Feb 1996 03:31:26 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb26203126@qcd.lanl.gov>
  8. References: <4gdh1b$bg@mailhost.mwmicro.com>
  9.     <larry_kearney-2302960806460001@amaryllisp1.appsig.com>
  10.     <4gsbq6$2dce@info4.rus.uni-stuttgart.de>
  11. NNTP-Posting-Host: qcd.lanl.gov
  12. Mime-Version: 1.0
  13. Content-Type: text
  14. In-reply-to: schweikh@itosun.ito.uni-stuttgart.de's message of 26 Feb 1996 13:15:50 GMT
  15.  
  16. In article <4gsbq6$2dce@info4.rus.uni-stuttgart.de>
  17. schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt) writes:
  18. <snip>
  19. JS: >   sscanf( string_buffer, "%x", int_value );
  20. JS: >   sscanf( string_buffer, "%lx", long_int_value );
  21. JS: 
  22. JS: At the risk of stating the obvious, my workstation will probably
  23. JS: dump core because sscanf wants _pointers_ to int_value and
  24. JS: long_int_value, i.e. &int_value.
  25.  
  26. Actually, &unsigned_int_value is required for %x format. Sending in a
  27. pointer to int results in undefined behaviour. (However, this should
  28. not matter unless the compiler explicitly checks for it: such checks
  29. are allowed, however).
  30.  
  31. Cheers
  32. Tanmoy
  33. --
  34. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  35. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  36. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  37. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  38. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  39. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  40.